package com.xcity.game.battle.pve.employee.impl;

import com.xcity.game.battle.BattleException;
import com.xcity.game.battle.pve.PlayerBattler;
import com.xcity.game.battle.pve.employee.EmployeeSkillBattleContext;
import com.xcity.game.common.MessageConst;
import com.xcity.game.employee.skill.EmployeeSkill;

import naga.x.game.time.TimeUpdater;

/**
 * 仅计算cd
 * @author yang.li
 *
 */
public class CDSkillContext extends EmployeeSkillBattleContext {

	public CDSkillContext(PlayerBattler player, EmployeeSkill ref) {
		super(player, ref);
	}

	@Override
	public boolean trigger() throws BattleException {
		if (isInCD()) {
			throw new BattleException(MessageConst.SKILL_IN_CD);
		}
		lastTriggerTime = TimeUpdater.getInstance().now();
		return true;
	}

}
